package Problem10;

import java.util.ArrayList;

public class Main {

	public static void main(String[] args) {
		ArrayList<Integer> primeNumbers = findPrimes();
		int answer = 0;
		for (int i: primeNumbers) {
			answer += i;
		}
		System.out.println(answer);

	}
	public static ArrayList<Integer> findPrimes(){
		ArrayList<Integer> primeNumbers = new ArrayList<Integer>();
		
		primeNumbers.add(2);
		for (int i = 2; i <= 2000000; i++) {
			boolean found = true;
			for (int prime: primeNumbers) {
				if ((i % prime) == 0){
					found = false;
					break;
				}
			}
			if (found)
				primeNumbers.add(i);
		}
		
		return primeNumbers;
	} 	

}
